package math;

import io.GPSPoint;

import java.util.ArrayList;
import java.util.List;

import ui.TimeSeriesName;
import ui.TimeSeriesName.TimeSeriesType;

public class ElevationProvider extends AbstractStatsProvider {

	@Override
	public TimeSeriesName getName(String name) {
		return new TimeSeriesName(TimeSeriesType.ELEVATION, name, "Elevation");
	}

	@Override
	void doWork() {
		List<Double> elevation = new ArrayList<Double>();
		List<Long> timesL = new ArrayList<Long>();
		for (int i = 0; i < gpsTracks.size(); i++) {
			GPSPoint currentPoint = gpsTracks.get(i);
			elevation.add(currentPoint.getEvelation());
			timesL.add(currentPoint.getTime());
		}
		values = Utils.toDoubles(elevation);
		times = Utils.toLongs(timesL);
	}


}
